#include <iostream>
#include <cmath>
using namespace std;

// 【题目194】计算两点之间的距离。

class Point
{
private:
    double x;
    double y;

public:
    Point(double x = 0, double y = 0)
    {
        this->x = x;
        this->y = y;
    }

    double distance(Point &p)
    {
        return sqrt((this->x - p.x) * (this->x - p.x) + (this->y - p.y) * (this->y - p.y));
    }
};

int main()
{
    Point p1(1, 2);
    Point p2(3, 4);
    cout << p1.distance(p2) << endl;
    return 0;
}
